<?php
class View
{
    protected $vars=array();
	
	protected function assign($var,$value)
	{
	    if(is_array($var))
		    $this->vars=array_merge($this->vars,$var);
		else
		    $this->vars[$var]=$value;
	}
	
	protected function display()
	{
	    include(ROOT_PATH.'/webApp/Template.class.php');
		$this->template=Template::GetInstance();
		$this->template->templatePath=ROOT_PATH.'Views/';
		$this->template->cache=true;
		$this->template->cachePath=ROOT_PATH.'/Cache/';
		$this->template->templateSuffix='.html';
		$this->template->leftTag='{';
		$this->template->rightTag='}';
		$templateFile=ROOT_PATH.'/Views/'.file.'.html';
		if(!file_exists($templateFile))
		    exit('template file '.$file.' not exist');
		$this->template->display($file,$this->vars);
	}
}
?>